import Vue from 'vue'

export default Vue.extend({
  name: 'js-comp-constructor',
  template: `<div @click="hanlderClick">{{title}}</div>`,
  data () {
    return {
      title: "我是通过.js文件创建出来的组件"
    }
  },
  methods: {
    hanlderClick () { 
      console.log('我是js模式组件提供的click方法')
    }
  },
  mounted () { 
    this.$el.style.width = '300px'
    this.$el.style.height = '200px'
    this.$el.style.backgroundColor = 'red'
    this.$el.style.margin ='0 auto'
    this.$el.style.lineHeight = '200px'
    this.$el.style.color = '#fff'
    this.$el.style.textAlign = 'center'
    this.$el.style.marginTop = '50px'
  }
})